package yanc.app

class Comm {
    String id

    Date createDate

    Date modifyDate
    /**
     * 主标题
     */
    String title
    /**
     * 副标题
     */
    String subTitle
    /**
     * 操作员
     */
    String oprator
    /**
     * 图片路径
     */
    String iconUrl
    /**
     * 新闻内容
     */
    String content

    Boolean status
    static hasMany = [branchs: Branch, businesss: Business]

    /**
     * 映射。
     */
    static mapping = {
        table "sys_comm"
        version false
        id(column: "id", sqlType: "varchar(32)", generator: 'uuid')
        createDate(column: "create_date", sqlType: "datetime")
        modifyDate(column: "modify_date", sqlType: "datetime")
        title(column: "title", sqlType: "varchar(64)")
        subTitle(column: "subTitle", sqlType: "varchar(64)")
        oprator(column: "oprator", sqlType: "varchar(32)")
        iconUrl(column: "icon_url", sqlType: "varchar(128)")
        content(column: "content", sqlType: "longtext")
        status(column: "status", sqlType: "tinyint(1)")
    }

    static constraints = {
        id(nullable: false, blank: false, unique: true)
        createDate(nullable: false, unique: false)
        modifyDate(nullable: true, unique: false)
        title(nullable: false, unique: false)
        subTitle(nullable: false, unique: false)
        oprator(nullable: false, unique: false)
        iconUrl(nullable: true, unique: false)
        content(nullable: false, unique: false)
        status(nullable: false, unique: false)
    }
}
